#ifndef _HW_H
#define _HW_H

/* Our own header for the programs that need hardware address info. */
/* we will define constants and function declarations here          */

#include <unp.h>
#include <sys/ioctl.h>          /* ioctls */
#include <net/if.h>             /* generic interface structures */
#include <linux/if_ether.h>
#include <net/ethernet.h> 	/* the L2 protocols */
#include <netpacket/packet.h> 	/* added for sockaddr_ll - raw socket */
#include <errno.h>
//#include <linux/if_arp.h>	

#define ETH_FCS_LEN 	4
#define IF_NAME         16      /* same as IFNAMSIZ    in <net/if.h> */
#define IF_HADDR         6      /* same as IFHWADDRLEN in <net/if.h> */
#define IP_ALIAS         1      /* hwa_addr is an alias */
#define ARPHRD_ETHER     1	/* defined in if_arp.h */

struct hwa_info {
  char    if_name[IF_NAME];     /* interface name, null terminated */
  char    if_haddr[IF_HADDR];   /* hardware address */
  int     if_index;             /* interface index */
  short   ip_alias;             /* 1 if hwa_addr is an alias IP address */
  struct  sockaddr  *ip_addr;   /* IP address */
  struct  hwa_info  *hwa_next;  /* next of these structures */
  char 	  ip[INET_ADDRSTRLEN];
};

/* function prototypes */
struct hwa_info *get_hw_addrs();
struct hwa_info *Get_hw_addrs();
void free_hwa_info(struct hwa_info *);

#endif
